package go_helper

import (
	SnowFlake "gitee.com/tym_hmm/go-helper/Library/snowFlake"
	"strconv"
)

/**
通过雪花算法生成唯一id
*/
func GetUniqueNum(NodeId int64) (string, error) {
	worker, err := SnowFlake.NewWorker(NodeId)
	if err != nil {
		return "0", err
	}
	id := worker.GetId()
	idStr := strconv.FormatInt(id, 10)
	return idStr, nil
}
